package br.com.app.view.form
{
	
	import Formularios.*;
	
	import mx.controls.Alert;
	import mx.core.Container;
	import mx.managers.PopUpManager;
	
	public class AppForm
	{
		
		public static function Open(window:Container, 
									formToOpen:String,
									data:Object=null):void
		{
			var formBaseToOpen: FormBase;
			
			//aqui faremos um switch oara instaciar diversos forms
			switch(formToOpen){
				// LOGIN
				case "FormLogin":
					formBaseToOpen = FormLogin(PopUpManager.createPopUp(window,FormLogin,true));
					break;
				case "FormPeriodo":
					formBaseToOpen = FormPeriodo(PopUpManager.createPopUp(window,FormPeriodo,true));
					break;
				case "FormNotasLancadas":
					formBaseToOpen = FormNotasLancadas(PopUpManager.createPopUp(window,FormNotasLancadas,true));
					break;
				case "FormTrocaSenha":
					formBaseToOpen = FormTrocaSenha(PopUpManager.createPopUp(window,FormTrocaSenha,true));
					break;						
				case "FormFreqLancadas":
					formBaseToOpen = FormFreqLancadas(PopUpManager.createPopUp(window,FormFreqLancadas,true));
					break;				
				case "FormProfessores":
					formBaseToOpen = FormProfessores(PopUpManager.createPopUp(window, FormProfessores, true));
					break;
				case "FormTrocaProf":
					formBaseToOpen = FormTrocaProf(PopUpManager.createPopUp(window, FormTrocaProf, true));
					break;
					
				case "FormAdminNotas":
					formBaseToOpen = FormAdminNotas(PopUpManager.createPopUp(window, FormAdminNotas, true));
					break;
					
				case "FormMPI":
					formBaseToOpen = FormMPI(PopUpManager.createPopUp(window, FormMPI, true));
					break;					
				// mais...
				
				default:
					mx.controls.Alert.show("Formlário não encontrado.");
					return;
					break;
			}
			
			formBaseToOpen.objectData = data;
			PopUpManager.centerPopUp(formBaseToOpen);
		}
		
		public function AppForm()
		{
		}

	}
}